package phantri.uit.menunhahang;

/**
 * The abstract class is for all models. It holds all of the generic.
 * Any class which want to be a model must inherit this class.
 * @author BINH
 * @version 1.0
 * */
public abstract class AbstractModel implements Comparable<AbstractModel> {
	protected String id;
	
	/**
	 * By using the ksoap-2 as bridge for iTable consume the web services.
	 * The ksoap-2 returns to iTable all in {@link Object} so it needs parsing to model for use.
	 * @param obj type of {@link Object} the return soap object or primitive soap needs parsing.
	 * */
	public abstract void parse(Object obj) throws ClassCastException;
	
	public void setID(String id) {
		this.id = id;
	}
	
	public String getID() {
		return id;
	}
	
	public int compareTo(AbstractModel o) {
		String thisId = new String(id);
		return thisId.compareTo(o.id);
	}
}

